// Test.cpp : 定义控制台应用程序的入口点。
//

#include "stdafx.h"
#include "..\\SqliteClsDyn\CSqlite.h"

#ifdef _DEBUG
#pragma comment(lib, "..\\bin\\debug\\sqliteclsdynd.lib")
#else
#pragma comment(lib, "..\\bin\\release\\sqliteclsdyn.lib")
#endif

int _tmain(int argc, _TCHAR* argv[])
{
	SQLite db;
	char str[] = "F:\\work\\安阳空气站\\文档\\数据来源\\gaia_air\\data\\hisdata.dat";
	char *utt = (char*)(str);
	if(!db.Open(utt))
	{
		return -1;
	}

	SQLiteDataReader reader = db.ExcuteQuery("select ref,datetime(tm,'unixepoch'),maxval,minval,avgval from minute_tab limit 50");
	while(reader.Read())
	{
		printf("%s\t%s\t%f\t%f\t%f\n", reader.GetStringValue(0), reader.GetStringValue(1), 
			reader.GetFloatValue(2), reader.GetFloatValue(3), reader.GetFloatValue(4));
	}

	return 0;
}